package isquirrel.servlets;

import isquirrel.servlets.handler.HttpDBServlet;

import java.io.IOException;

import javax.servlet.ServletException;

import org.json.JSONException;

/**
 * Servlet implementation class DBpedia
 */
public class DBpediaService extends HttpDBServlet {
	private static final long serialVersionUID = 1L;

    /**
     * Default constructor. 
     */
    public DBpediaService() {
    }


	@Override
	protected void handleGet() throws ServletException, IOException,
			JSONException {
		/*
		DBpedia dbPedia = new DBpedia();
	Property property = new Property(
				"http://www.w3.org/2004/02/skos/core#subject",
				"http://dbpedia.org/resource/Category:Health_disasters");
		Property three = new Property(
				"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
				"http://dbpedia.org/class/yago/Pandemics");
		Property two = new Property(
				"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
				"http://dbpedia.org/class/yago/Syndromes");
		List<Property> list = new LinkedList<Property>();

		list.add(property);
		List<String> urls = (List<String>) dbPedia.getUrls(list);

		for (String url : urls) {
			System.out.println(url);
		}

		System.out.println("*******************************");
		list.add(two);
		urls = (List<String>) dbPedia.getUrls(list);

		for (String url : urls) {
			System.out.println(url);
		}

		System.out.println("*******************************");
		list.add(three);
		urls = (List<String>) dbPedia.getUrls(list);

		for (String url : urls) {
			System.out.println(url);
		}
		
		dbPedia.getPageInformation("http://en.wikipedia.org/wiki/Madame_Tussauds");

		dbPedia.getPageInformation("http://en.wikipedia.org/wiki/George_W._Bush/");
		
		//System.out.println(dbPedia.getThumbnail("http://en.wikipedia.org/wiki/Madame_Tussauds"));

		//System.out.println(dbPedia.getThumbnail("http://en.wikipedia.org/wiki/George_W._Bush"));
		*/
		
	}

	@Override
	protected void handlePost() throws ServletException, IOException,
			JSONException {
		
	}

}
